﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VisitorPattern.BLL.Interface;
using VisitorPattern.Model;

namespace VisitorPattern.BLL
{

    /// <summary>
    /// 收入
    /// </summary>
    class IncomeVisitor : IVisitor<Employee>
    {

        public override void Visit(Employee employee)
        {

            // Provide 10% pay raise
            employee.Income *= 1.10;
            Console.WriteLine("{0}'s new income: {1:C}",
              employee.Name, employee.Income);
        }
    }

    /// <summary>
    /// 假日
    /// </summary>
    class VacationVisitor : IVisitor<Employee>
    {

        public override void Visit(Employee employee)
        {
            // Provide 3 extra vacation days
            employee.VacationDays += 3;
            Console.WriteLine("{0}'s new vacation days: {1}",
              employee.Name, employee.VacationDays);
        }
    }
}
